import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/components/Home'
import Welcome from '@/components/Welcome'
import User from '@/components/User'
import Right from '@/components/Right'
import Role from '@/components/Role'
import Cate from '@/components/Cate'
import Param from '@/components/Param'
import Order from '@/components/Order'
import Goods from '@/components/Goods'
import GoodsAdd from '@/components/GoodsAdd'
import Report from '@/components/Report'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    {
      path: '/home',
      component: Home,
      children: [
        { path: '/', redirect: '/welcome' },
        { path: '/welcome', component: Welcome },
        { path: '/users', component: User },
        { path: '/rights', component: Right },
        { path: '/roles', component: Role },
        { path: '/categories', component: Cate },
        { path: '/params', component: Param },
        { path: '/orders', component: Order },
        { path: '/goods', component: Goods },
        { path: '/goodsadd', component: GoodsAdd },
        { path: '/reports', component: Report }
      ]
    }
  ]
})
